
%% Init
clc;close;clear
addpath("./M_Function/")
hold all
s = tf('s');
%% LeadLag
K = 1;
w1 = 10;
w2 = 100;

% Lead Loop
wz = w1; Tz = 1/wz;
wp = w2; Tp = 1/wp;
Lead_Loop = K * (Tz*s+1)/(Tp*s+1);

% Lag Loop
wz = w2; Tz = 1/wz;
wp = w1; Tp = 1/wp;
Lag_Loop = K * (Tz*s+1)/(Tp*s+1);


% LeadLag_Loop = K * (Tp*s+1)/(Tz*s+1);

figure(1)
bode(Lead_Loop)
bode(Lag_Loop)
% bode(LeadLag_Loop)
legend("Lead Loop","Lag Loop","LeadLag Loop")